cc.Class({
    extends: cc.Component,

    properties: {
        head:cc.Sprite,
        state:cc.Label,
    },

    onLoad: function () {
        this.usrID = -1;
    },

    setUsrID:function(usrID)
    {
        this.usrID = usrID;
    },

    getUsrID:function()
    {
        return this.usrID;
    },

    loadHeadUrl:function(url)
    {
        //http://tupian.enterdesk.com/2014/lxy/2014/12/01/5/1.jpg
        cc.loader.load(url,function (err, texture) {
                if (err == null) {
                    var frame=new cc.SpriteFrame(texture);
                    this.head.getComponent(cc.Sprite).spriteFrame = frame;
                }
        }.bind(this));
    },

    changeState:function(isReady)
    {
        this.state.node.active = isReady;
    },

});
